<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
	
	</body>
	<script>
		function setCookie(name, value) {
			var Days = 30;
			var exp = new Date();
			exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
			document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
		}

		//读取cookies 
		function getCookie(name) {
			var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

			if(arr = document.cookie.match(reg))

				return unescape(arr[2]);
			else
				return null;
		}

		function getQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			var r = window.location.search.substr(1).match(reg);
			if(r != null) return unescape(r[2]);
			return null;
		}
		
		var userids = getQueryString('userid');
		var detailsid = getQueryString('detailsid');
		var wxopenid = getQueryString('wxopenid');
		
		//alert('wxopenid='+wxopenid);
		
		setCookie('amxl_detailsid',"-1");
		setCookie('amxl_extid',"0");
		setCookie('amxl_wxopenid',wxopenid);
		
		
		if(userids!=null && userids!='' && userids!=undefined){
			setCookie('amxl_extid',userids);
			
			//是否携带商品编号
			if(detailsid!=null && detailsid!='' && detailsid!=undefined){
				setCookie('amxl_detailsid',detailsid);
			}
		}
		else{
			console.log('hehe');			
		}
		
		var tourls = 'http://www.amyshirley.com/aml/index.html?';
		//window.location.href=tourls;
		window.location.replace(tourls);
		
	</script>

</html>